<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:64:"E:\activity\public/../application/admin\view\user_type\edit.html";i:1545919276;s:56:"E:\activity\public/../application/admin\view\layout.html";i:1545921282;s:61:"E:\activity\public/../application/admin\view\home\header.html";i:1545574969;s:65:"E:\activity\public/../application/admin\view\home\navigation.html";i:1546011362;s:61:"E:\activity\public/../application/admin\view\home\footer.html";i:1545842063;}*/ ?>
﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo $token['config']['title']; ?></title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="apple-touch-icon" type="image/x-icon" href="__IMG__\favicon.ico">
    <link rel="shortcut icon" type="image/x-icon" href="__IMG__<?php echo $token['config']['image']; ?>">
    <link rel="stylesheet" href="__STATIC__/plugin/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_503496_sgntl8o48mqb0529.css">
    <link rel="stylesheet" href="__CSS__/common/common.css">
    <link rel="stylesheet" href="__CSS__/admin/admin.css">
    <link rel="stylesheet" href="__JS__/layui/css/layui.css">
    <link rel="stylesheet" href="/public/static/css/base.css" >
    <style type="text/css">
        .table-responsive{
            min-height: 550px;
        }
        tr{
            text-align: center;
            height: 45px;
        }
        a.ncap-btn-green {
            font: bold 14px/20px "microsoft yahei", arial;
            color: #FFF;
            text-shadow: 0 -1px 0 rgba(0,0,0,0.10);
            background-color: #1BBC9D;
            text-align: center;
            vertical-align: middle;
            display: inline-block;
            height: 34px;
            padding: 7px 14px;
            margin-bottom: 5px;
            margin-right: 3px;
            border: solid 1px #BEC3C7;
            border-radius: 3px;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="header">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                        data-target="#example-navbar-collapse">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <?php if($token["config"]["logo"] == 0){ ?>
                    <a class="navbar-brand" href="">
                        <img class="logo" src="__STATIC__/assets/logo.png">
                        <span class="nav-name"></span>
                    </a>
                <?php } else { ?>
                    <a class="navbar-brand" href="">
                        <img class="logo" src="__IMG__<?php echo $token['config']['image']; ?>"/>
                        <span class="nav-name" style="color: #cccccc;margin-left: 41px;"><?php echo $token['config']['slogan']; ?></span>
                    </a>
                <?php } ?>
            </div>
            <div class="collapse navbar-collapse"  id="example-navbar-collapse">
                <ul class="nav navbar-nav  navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-refresh"></span> 切换
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="<?php echo url('Admin/Upload/index',array('user_activity' => 0)); ?>">
                                    <span class="glyphicon glyphicon-globe"></span> 活动管理
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('Admin/Upload/index',array('user_activity' => 1)); ?>">
                                    <span class="glyphicon glyphicon-shopping-cart"></span>  商城管理
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a id="showLeftTime"></a>
                    </li>
                    <li class="active">
                        <a href="javascript:getCaching()">
                            <span class="glyphicon glyphicon-trash"></span>  清除缓存
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Admin/Index/Index'); ?>">
                            <span class="glyphicon glyphicon-new-window"></span> 首页
                        </a>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-user"></span> <?php echo $token["nickname"]; ?>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="<?php echo url('Admin/User/Password'); ?>">
                                    <span class="glyphicon glyphicon-pencil"></span> 修改密码
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('Admin/User/EditInfo'); ?>">
                                    <span class="glyphicon glyphicon-list-alt"></span> 用户信息
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-cog"></span> 用户管理
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="__HTTP__/Admin">
                                    <span class="glyphicon glyphicon-new-window"></span> 首页
                                </a>
                            </li>
                            <?php if($token["user_type"] == 1) { ?>
                                <li>
                                    <a href="javascript:EliminateToken()">
                                        <span class="glyphicon glyphicon-trash"></span> 清除令牌缓存
                                    </a>
                                </li>
                                <!--<li>
                                    <a href="javascript:fileByConfigure()">
                                        <span class="glyphicon glyphicon-refresh"></span> 文件重新配置
                                    </a>
                                </li>-->
                            <?php } ?>
                            <li>
                                <a href="javascript:getLogout()">
                                    <span class="glyphicon glyphicon-log-out"></span>  退出登录
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</div>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script src="__CSS-JS__layer/layer.js"></script>
<script src="__CSS-JS__layer/extend/layer.ext.js"></script>
<script type="text/javascript">
    function showLeftTime() {
        var now=new Date();
        var year=now.getFullYear();
        var month=now.getMonth()+1;
        var day=now.getDate();
        var hours=now.getHours();
        var minutes=now.getMinutes();
        var seconds=now.getSeconds();
        var nowDay = now.getDay();
        if(nowDay == 0){ nowDay = "星期日"; }
        if(nowDay == 1){ nowDay = "星期一"; }
        if(nowDay == 2){ nowDay = "星期二"; }
        if(nowDay == 3){ nowDay = "星期三"; }
        if(nowDay == 4){ nowDay = "星期四"; }
        if(nowDay == 5){ nowDay = "星期五"; }
        if(nowDay == 6){ nowDay = "星期六"; }
        document.getElementById("showLeftTime").innerHTML="<span class='glyphicon glyphicon-calendar'></span>  "+year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds+" "+nowDay+"";
        //一秒刷新一次显示时间
    }
    window.setInterval('showLeftTime()',1000);
    function EliminateToken() {
        layer.confirm('该缓存一清空,所有用户必须重新登录', {
            icon: 3,btn: ['清空','取消'] //按钮
        }, function(){
            $.ajax({
                type:'post',
                url: '<?php echo url("Admin/Upload/getToken"); ?>',
                success: function (res) {
                    layer.msg('请重新登录', {icon: 1,time: 2000});
                    setTimeout('getLogin()',3000);
                }
            })
        }, function(){
            layer.msg('取消清除令牌缓存', {icon: 0,time: 2000});
        });
    }
    function fileByConfigure() {
        var test = window.location.href;
        test = test.split("index.php")[0];
        layer.confirm('如果页面显示正常，请不要操作该项',{
            icon: 3,btn: ['确认','取消'] //按钮
        }, function () {
            $.ajax({
                type:"post",
                url:"<?php echo url('Admin/Upload/fileByConfigure'); ?>",
                success:function (res) {
                    layer.msg('操作成功', {icon: 1,time: 2000});
                    setTimeout('window.location.href="<?php echo url('admin/index/index'); ?>"',3000);
                }
            });
        }, function () {
            layer.msg("取消操作",{icon:0,time:2000});
        });
    }
    function getLogout() {
        $.ajax({
            type:"post",
            url:"<?php echo url('Admin/User/Logout'); ?>",
            success:function (res) {
                SUCCESSAlert("成功退出登录");
                setTimeout('getLogin()',3000);
            }
        })
    }
    function getLogin() {
        window.location.href="<?php echo url('Login/Login/login'); ?>";
    }
    function getCaching() {
        $.ajax({
            type:'post',
            url: "<?php echo url('Admin/Upload/getCaching'); ?>",
            success: function (res) {
                var data = "清除缓存成功";
                if(res == "没有操作权限"){
                    data = res;
                }
                SUCCSSAlert(data);
            }
        })
    }
    function SUCCSSAlert(e) {
        layer.alert(e, {
            icon: 1,
            skin: 'layer-ext-moon',
            time: 2000,
            offset: 't',
            closeBtn: 0,
            title: '温馨提示',
            btn: [],
            shift:4
        });
    }
</script> 
<div class="content">
    <div class="row" style="height: 100%;">
        <div class="menu col-md-2" style="padding-right: 0px;padding-left: 0px;">
    <div class="menu-wrapper">
        <ul class="menu-first-list">
            <li class="menu-first-item" attr-id="1" >
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>系统功能</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/Upload/index'); ?>">图片管理</a></li>
                    <li><a href="<?php echo url('Admin/Config/index'); ?>">系统配置</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="2">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>数据库安全</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/Backups/dataBase'); ?>">数据库</a></li>
                    <li><a href="<?php echo url('Admin/Backups/Index'); ?>">备份记录</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="3">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>系统权限</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/UserType/Index'); ?>">用户权限</a></li>
                    <li><a href="<?php echo url('Admin/User/add'); ?>">添加用户</a></li>
                    <li><a href="<?php echo url('Admin/User/user'); ?>">用户管理</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="4">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>用户管理</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/Member/Index'); ?>">用户管理</a></li>
                    <li><a href="<?php echo url('Admin/Address/Index'); ?>">用户收货地址</a></li>
                </ul>
            </li>
            <?php  if($user_activity == 0 || !$user_activity) {  ?>
            <li class="menu-first-item" attr-id="5">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>活动banner轮播</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/Banner/Index'); ?>">活动banner轮播</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="6">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>资讯中心</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/NewsType/Index'); ?>">资讯类型列表</a></li>
                    <li><a href="<?php echo url('Admin/News/Index'); ?>">资讯列表</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="7">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>活动管理</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                </ul>
            </li>
            <?php  } else {  ?>
            <li class="menu-first-item" attr-id="5">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>商品banner轮播</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/GoodsBanner/Index'); ?>">商品banner轮播</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="6">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>商品管理</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('Admin/GoodsType/Index'); ?>">商品分类</a></li>
                    <li><a href="<?php echo url('Admin/Goods/Index'); ?>">商品列表</a></li>
                </ul>
            </li>
            <li class="menu-first-item" attr-id="7">
                <p class="item-title">
                    <i class="iconfont left-btn"></i>
                    <span>物流配送</span>
                    <i class="iconfont icon-right"></i>
                </p>
                <ul class="menu-second-list">
                    <li><a href="<?php echo url('admin/ShopAddress/index'); ?>">设置发货地址</a></li>
                    <li><a href="<?php echo url('admin/Express/index'); ?>">物流配送</a></li>
                </ul>
            </li>
            <?php  }  ?>
        </ul>
    </div>
</div>
        <div class="col-md-10">
            <div class="content-wrapper">
                <span class="glyphicon glyphicon-map-marker" aria-hidden="true" style="position: absolute;top: 23px;">
    <span>系统</span> /
    <span>系统权限</span> /
    <span>编辑管理权限</span>
</span>
<row>
    <div class="col-md-12" style="margin-top: 37px;">
        <form class="form-horizontal layui-form" id="form">
            <div class="form-group">
                <label for="name" class="col-md-2 control-label">
                    <div class="text-center">管理权限</div>
                </label>
                <div class="col-md-6">
                    <input type="text" class="form-control" id="name" name="name"
                           placeholder="管理权限" value="<?php echo $list['name']; ?>">
                </div>
            </div>
            <div class="form-group">
                <label for="name" class="col-md-2 control-label">
                    <div class="text-center">选择操作权限</div>
                </label>
                <div class="col-md-9">

                    <table class="table" width="100%" border="1">
                        <?php if(is_array($permission) || $permission instanceof \think\Collection || $permission instanceof \think\Paginator): $i = 0; $__LIST__ = $permission;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td colspan="2" style="text-align: left;vertical-align: middle;"><?php echo $vo['title']; ?></td>
                        </tr>
                        <?php if(is_array($vo['list']) || $vo['list'] instanceof \think\Collection || $vo['list'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$title): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td width="20%" style="text-align: right;vertical-align: middle;"><?php echo $title['title']; ?></td>
                            <td style="text-align: left;vertical-align: middle;">
                                <?php if(is_array($title['list']) || $title['list'] instanceof \think\Collection || $title['list'] instanceof \think\Paginator): $i = 0; $__LIST__ = $title['list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;if($vo['title'] == '系统功能'): ?>
                                <!--<label class="checkbox-inline">-->
                                <input type="checkbox" name="Jurisdiction" lay-skin="primary" title="<?php echo $v['title']; ?>" checked value="<?php echo $v['url']; ?>">
                                <!--</label>-->
                                <?php else: ?>
                                <!--<label class="checkbox-inline">-->
                                <input type="checkbox" name="Jurisdiction" lay-skin="primary" title="<?php echo $v['title']; ?>" value="<?php echo $v['url']; ?>" <?php if(strpos($list['jurisdiction'],$v['url'])){?> checked="checked" <?php } ?>>
                                <!--</label>-->
                                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?>
                    </table>

                </div>
            </div>

            <div class="form-group save-btn" style="">
                <button type="button" onclick="Edit(<?php echo $list['id']; ?>)" >提交</button>
                <button type="button" onclick="javascript:history.back(-1);return false;" style="background: red;">取消</button>
            </div>
        </form>
    </div>
</row>
<style type="text/css">
    .layui-unselect{
        margin-left: 4px;
        margin-top: 15px;
    }
</style>
<script src="__JS__/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function() {
        var form = layui.form
                , layer = layui.layer;
    });
</script>
<script type="text/javascript">
    function Edit(id) {
        var name = $("input[id='name']").val();
        if(name == ""){
            layer.msg("请输入管理权限");
            return false;
        }
        var obj = document.getElementsByName("Jurisdiction");
        var s='';
        for(var i=0; i<obj.length; i++){
            if(obj[i].checked){
                s+=obj[i].value+'|'; //如果选中，将value添加到变量s中
            }
        }
        var jurisdiction = s;
        var json = {id:id,name:name,jurisdiction:jurisdiction};
        $.ajax({
            type:"POST",
            url:"<?php echo url('Admin/UserType/Edit'); ?>",
            data:json,
            success:function (res) {
                console.log(res);
                layer.msg(res);
                if(res == "编辑成功"){
                    setTimeout("UserType()",3000);
                }
            }
        });
    }
    function UserType() {
        window.location.href = "<?php echo url('Admin/UserType/index'); ?>";
    }
</script>
            </div>
        </div>
    </div>
    <div class="footer">
    <?php echo $token['config']['record']; ?>&nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;<?php echo $token['config']['copyright']; ?>
</div>
<script type="text/javascript">
    function location_href() {
        window.location.href = window.location.href;
    }function success(e) {
        layer.alert(e, {
            icon: 1,
            skin: 'layer-ext-moon',
            time: 2000,
            offset: 't',
            closeBtn: 0,
            title: '温馨提示',
            btn: [],
            shift:4
        });
    }
    function error(e) {
        layer.alert(e, {
            icon: 2,
            skin: 'layer-ext-moon',
            time: 2000,
            offset: 't',
            closeBtn: 0,
            title: '温馨提示',
            btn: [],
            shift:4
        });
    }
    function title(title) {
        layer.msg(title);
    }
    function msg(title) {
        layer.msg(title);
    }
</script>
</div>
<input type="hidden" value='<?php echo $token["errMsg"]; ?>' id="token"  />
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true" style=" margin-left: 100px;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
            </div>
            <div class="modal-body" id="modal_yuan" style='text-align: center;'>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/plugin/JquerySession.js"></script>
<script src="__JS__/common/common.js"></script>
<script src="__JS__/admin/admin.js"></script>
<script type="text/javascript" src="__CSS-JS__/plupload/plupload.full.min.js"></script>
<script src="__JS__/layui/layui.js" charset="utf-8"></script>
<script>

</script>
</body>
</html>
<script type="text/javascript">
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        //时间范围
        laydate.render({
            elem: '#business'
            ,type: 'time',
            range: true
        });
    });
    function getPicture(id) {
        $.ajax({
            type:"post",
            url:"<?php echo url('Admin/Upload/picture'); ?>",
            data:{
                id:id
            },
            success:function (res) {
                document.getElementById("modal_yuan").innerHTML="<img src='__IMG__"+res+"' width='90%' />";
            }
        });
    }
    window.onload = function () {
        var url = window.location.href;
        if(url.search("public") == -1){
            window.location.href = "http://"+window.location.host+"/tp/public/admin.php";
        }
        showLeftTime();
        var token = document.getElementById("token").value;
        if(token != ""){
            SUCCESSAlert("请登录后,在操作");
            setTimeout('login()',3000);
            return;
        }
        if(document.getElementById("error")){
            PageError();
        }
        if(document.getElementById("PS")){
            var pid = document.getElementById("PS").value;
            var group = document.getElementById("group").value;
            onLoadGrop(pid,group);
        }
        if(document.getElementById("typeid") && document.getElementById("sid")){
            var typeid = document.getElementById("typeid").value;
            var sid = document.getElementById("sid").value;
            ServiceitemSId(typeid,sid);
        }
    }
    function Alert(text,id) {
        layer.msg(text,
            {icon:id,time:2000,offset:'t',closeBtn:0,shift:4});
    }
    function login() {
        window.location.href="<?php echo url('Login/Login/login'); ?>";
    }
    function getCheckboxByIds(id) {
        var ids = $("input[id='ids-"+id+"']").is(':checked');
        if(!ids){
            $("input[id='ids']").prop('checked',false);
        }
        var items = document.getElementsByName("ids[]");         //这个语句帮我们筛选出一组name为checked的复选框。。
        for(var j=0; j<items.length; j++){
            if(!items[j].checked){               //如果该复选框被选中
                return;                         //统计被选中的个数
            }
        }
        $("input[id='ids']").prop("checked", "true");
    }
    function getCheckbox() {
        var ids = $("input[id='ids']").is(':checked');
        if(ids) {
            $("input[name='ids[]']").prop("checked", "true");
        } else {
            $("input[name='ids[]']").prop('checked',false);;
        }
    }
    $(document).ready(function(){
        $(".edit-btn").mousemove(function(e){
            this.setAttribute("style","color: #ffffff;background-color: #138de6;");
        });
        $(".edit-btn").mouseout(function(e){
            this.setAttribute("style","background-color: #ffffff;color: #138de6;");
        });
        $(".disable-btn").mousemove(function(e){
            this.setAttribute("style","color: #ffffff;background-color: #ebb724;");
        });
        $(".disable-btn").mouseout(function(e){
            this.setAttribute("style","background-color: #ffffff;color: #ebb724;");
        });
        $(".enable-btn").mousemove(function(e){
            this.setAttribute("style","color: #ffffff;background-color: #2bc286;");
        });
        $(".enable-btn").mouseout(function(e){
            this.setAttribute("style","background-color: #ffffff;color: #2bc286;");
        });
        $(".delete-btn").mousemove(function(e){
            this.setAttribute("style","color: #ffffff;background-color: red;");
        });
        $(".delete-btn").mouseout(function(e){
            this.setAttribute("style","background-color: #ffffff;color: red;");
        });
    });
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: '<?php echo url("Admin/Upload/lay_img_upload"); ?>'
            ,before: function(obj){
                obj.preview(function(index, file, result){
                    $('#image').attr('src', result);
                });
            }
            ,done: function(res){
                console.log(res);
                $('#logo').attr('value', res.id);
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });

        uploadInst = upload.render({
            elem: '#test2'
            ,url: '<?php echo url("Admin/Upload/lay_img_upload"); ?>'//'__HTTP__/lay_img_upload'
            ,before: function(obj){
                obj.preview(function(index, file, result){
                    $('#imgs').attr('src', result);
                });
            }
            ,done: function(res){
                $('#img').attr('value', res.id);
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });

        uploadInst = upload.render({
            elem: '#page3'
            ,url: '<?php echo url("Admin/Upload/lay_img_upload"); ?>'
            ,before: function(obj){
                obj.preview(function(index, file, result){
                    $('#pages').attr('src', result);
                });
            }
            ,done: function(res){
                $('#page').attr('value', res.id);
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>